<script setup>
import zhCN from 'ant-design-vue/es/locale/zh_CN';
import dayjs from 'dayjs';
import 'dayjs/locale/zh-cn';
dayjs.locale('cn-zh');

import Menu from "./components/common/Menu.vue";
import MainFloatButton from "./components/common/MainFloatButton.vue";
import Login from "./components/common/Login.vue";
import Content from "./components/common/Content.vue";
// 登录状态
const loginState = localStorage.getItem('loginState') || 'no';
// 获取当前路由信息
onMounted(() => {
  // console.log('浏览器语言: ' , navigator.language);
});

</script>

<template>
  <a-config-provider :locale="zhCN">
    <template v-if="loginState !== 'ok'"><Login /></template>
    <template v-else>
      <div class="flex-row">
        <!--    左侧菜单    -->
        <Menu class="w-10-p"/>

        <!--    右侧 内容-->
        <Content class="w-90-p padding-10-0"/>

        <!--    底部固钉  和 右侧消息抽屉  -->
        <MainFloatButton/>
      </div>
    </template>
  </a-config-provider>
</template>

<style scoped>
.flex-row {
  display: flex;
  flex-direction: row;
}
.w-10-p {
  width: 190px;
}
.w-90-p {
  width: calc(100% - 190px);
}
.padding-10-0 {
  padding: 10px 0;
}
</style>
